package com.example.textviewactivity;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.example.textviewactivity.pojo.User;

import java.io.Serializable;

public class LoginSuccessActivity extends AppCompatActivity {
    TextView tv;
    String like="";
    private static final String TAG = "LoginSuccessActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login_success);
        tv=findViewById(R.id.show);
        Intent intent=getIntent();
        User user = (User) intent.getSerializableExtra("user");
        String[] hobby = user.getHobby();
        for (int i = 0; i < hobby.length; i++) {
            if (hobby[i]!=null){
                like+=hobby[i]+":";
            }
        }
        tv.setText("用户名:"+user.getName()+"\n"+"密码:"+user.getPassword()+"\n"+"号码:"+user.getPhone()+"\n爱好:"+like+"\n性别:"+user.getSex());
    }
}
